package com.intern.hackathon.internhackathon;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;

public class MainActivity extends Activity {
	private static final int SPLASH_DISPLAY_TIME = 2000; /* 2 seconds */

	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);

		new Handler().postDelayed(new Runnable() {
			@Override
			public void run() {

				/* Create an intent that will start the dashboard. */
				Intent mainIntent = new Intent(MainActivity.this,
						DashBoard.class);
				MainActivity.this.startActivity(mainIntent);

				/* Finish splash activity so user cant go back to it. */
				MainActivity.this.finish();

				/*
				 * Apply our splash exit (fade out) and main entry (fade in)
				 * animation transitions.
				 */
				overridePendingTransition(R.anim.fade_in, R.anim.fade_out);
			}
		}, SPLASH_DISPLAY_TIME);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		getMenuInflater().inflate(R.menu.main_menu, menu);
		return true;
	}

	@Override
	public boolean onOptionsItemSelected(MenuItem item) {
		// TODO Auto-generated method stub
		switch (item.getItemId()) {
	    case R.id.item_1:
	        Toast.makeText(getApplicationContext(), "Item 1 Clicked!!", Toast.LENGTH_SHORT).show();
	        return true;
	    case R.id.item_2:
	        Toast.makeText(getApplicationContext(), "Item 2 Clicked!!", Toast.LENGTH_SHORT).show();
	        return true;
	    case R.id.item_3:
	        Toast.makeText(getApplicationContext(), "Item 3 Clicked!!", Toast.LENGTH_SHORT).show();
	        return true;
	    case R.id.item_4:
	        Toast.makeText(getApplicationContext(), "Item 4 Clicked!!", Toast.LENGTH_SHORT).show();
	        return true;
	    case R.id.item_5:
	        Toast.makeText(getApplicationContext(), "Item 5 Clicked!!", Toast.LENGTH_SHORT).show();
	        return true;
	    case R.id.menu_settings:
	        Toast.makeText(getApplicationContext(), "Menu Settings Clicked!!", Toast.LENGTH_SHORT).show();
	        return true;
	    
	    default:
	        return super.onOptionsItemSelected(item);
	    }
	}
	


}
